﻿using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Koonsoft.HYCRM.BLL;
using org.in2bits.MyXls;

public partial class AnnualCheck_LostBuildCheckList : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Button1_Click(object sender, EventArgs e)
    {

        var branchID = Convert.ToInt32(DropDownList3.SelectedValue);
        int month = DateTime.Now.Month;

        var dt = new YearAuditBLL().GetAnnualCheckMissions(DateTime.Now.AddMonths(-1).Month, branchID, DateTime.Now.AddMonths(-1).Year);

        for (int i = -2; i >= -12; i--)
        {
            dt.Merge(new YearAuditBLL().GetAnnualCheckMissions(DateTime.Now.AddMonths(i).Month, branchID,
                                                               DateTime.Now.AddMonths(i).Year));
        }

        GridView1.DataSource = dt;
        GridView1.DataBind();

    }
}